<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<ul class="pagination">
    <c:if test="${pager.isFirstPage}">
    <li class="disabled"><a href="#" style="pointer-events: none;">&laquo;</a></li>        
    </c:if>
    
    <c:if test="${!pager.isFirstPage}">
    <li><a href="#" onclick="return ${param.changeOffsetFunction}(${(pager.currentPageNumber - 2) * pager.itemsPerPage})">&laquo;</a></li>
    </c:if>
             
     <c:forEach items="${pager.pageOffsets}" var="pageOffset" varStatus="theCount">                    
         <li class="${pager.currentPageNumber == theCount.count ? 'active' : ''}">
             <a href="#" onclick="${param.changeOffsetFunction}(${pageOffset})">
                ${theCount.count}
            </a>
         </li>
     </c:forEach>

     <c:if test="${!pager.isLastPage}">
         <li><a href="#" onclick="return ${param.changeOffsetFunction}(${pager.currentPageNumber * pager.itemsPerPage})">&raquo;</a>
         </li>
    </c:if>
    <c:if test="${pager.isLastPage}">
    <li class="disabled"><a href="#" style="pointer-events: none;">&raquo;</a></li>
    </c:if>

</ul>
